<?php

abstract class Configuracion {

    private function getParametros($tipo, $base) {
        //atlas desarrollo
        $CNF['atlasdev']['conn']['host'] = '172.17.4.224';
        $CNF['atlasdev']['conn']['dbname'] = 'atlasdb';
        $CNF['atlasdev']['conn']['user'] = 'postgres';
        $CNF['atlasdev']['conn']['password'] = 'hol4mundo';
        $CNF['atlasdev']['opt']['conn'] = 'postgres';
        $CNF['atlasdev']['opt']['limit'] = 'limit $num';
        $CNF['atlasdev']['opt']['offset'] = 'offset $num';        
       	//odbc
        $CNF['sigdocbbvadb2dev']['conn']['host'] = 'DATA400';
        $CNF['sigdocbbvadb2dev']['conn']['dbname'] = 'S0';
        $CNF['sigdocbbvadb2dev']['conn']['user'] = 'DSR';
        $CNF['sigdocbbvadb2dev']['conn']['password'] = 'DSR';
        $CNF['sigdocbbvadb2dev']['opt']['conn'] = 'odbc';
        //base de prueba para mysql
        $CNF['viator']['conn']['host'] = '172.17.4.27';
        $CNF['viator']['conn']['dbname'] = 'lib';
        $CNF['viator']['conn']['user'] = 'prbm';
        $CNF['viator']['conn']['password'] = 'p060';
        $CNF['viator']['opt']['conn'] = 'mysql';
        //dbsqlite dev
        $CNF['mtidemo']['conn']['host'] = '';
        $CNF['mtidemo']['conn']['dbname'] = 'c:\mtidemo.db';
        $CNF['mtidemo']['conn']['user'] = '';
        $CNF['mtidemo']['conn']['password'] = '';
        $CNF['mtidemo']['opt']['conn'] = 'sqlite';
        //sigdoc oracle local
        $CNF['sigdocbbvaocidev']['conn']['host'] = '127.0.0.1';
        $CNF['sigdocbbvaocidev']['conn']['dbname'] = 'XE';
        $CNF['sigdocbbvaocidev']['conn']['user'] = 'ADMINBBVA';
        $CNF['sigdocbbvaocidev']['conn']['password'] = 'ADMINBBVA';
        $CNF['sigdocbbvaocidev']['opt']['conn'] = 'oci';
        return $CNF[strtolower($base)][$tipo];
    }

    public function getConfiguracion($base) {
        return $this->getParametros('conn', $base);
    }

    public function getOpciones($base) {
        return $this->getParametros('opt', $base);
    }

    public function getFTP($base) {
        return $this->getParametros('ftp', $base);
    }

    public function getType($base) {
        $type = $this->getParametros('opt', $base);
        return $type['conn'];
    }

    public function getConnection_string($base) {
        $cad = array();
        foreach ($this->getParametros('conn', $base) as $key => $value) {
            array_push($cad, $key . '=' . $value);
        }
        return implode(' ', $cad);
    }

}

?>
